home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Demos
/
A.D. Software
/
OOFILE
/
Buildable, limited OOFILE
/
samples
/
ooftst14.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-03-29
|
2KB
|
67 lines
// Copyright 1995 A.D. Software. All Rights Reserved
// OOFTEST14 - Mixture of OOFTest1 and 4 with HTML Reports
// Simple stream I/O is used to interact with the user.
#include "oofile.hpp"
#include "oofhtml.hpp"
#include "ooftst01.inc"
int main()
{
cout << "OOFILE Validation Suite - Test HTML\n"
<< "Simple test of the HTML Report Writer\n";
dbConnect_ctree theDB;
dbPeople People;
theDB.useSeparateFiles(); // note the blank connection names!
// this test creates People.dat, People.idx & Blobs
if (dbConnect::fileExists("People.dat"))
theDB.openConnection("");
else {
theDB.newConnection("");
People.AddTestData();
}
People.setSortOrder(People.LastName);
cout << "This test produces the columnar and pagewise reports in two variants," << endl
<< "first using plain HTML then using the Netscape tables" << endl << endl
<< "Producing simple HTML Columnar report to oofts14a.htm...";
dbView theView(People);
theView << People.LastName << People.OtherNames << People.Description;
ofstream fs("oofts14a.htm");
dbRepHTML tempReport(dbRepSizer("Demo Columnar Report").pageHeight(80),
dbRepColWidths() << 10 << 15 << 50, theView);
tempReport.draw(fs);
fs.close();
cout << endl << "Creating a PageWise report to oofts14b.htm"<< endl;
ofstream fs2("oofts14b.htm");
dbRepHTML tempReport2(dbRepSizer("Demo Page-wise Report").pageHeight(80),
dbRepColWidths() << 15 << 60,theView, dbRep::pageWise);
tempReport2.draw(fs2);
fs2.close();
cout << endl << "Creating a Columnar report to oofts14c.htm"<< endl;
ofstream fs3("oofts14c.htm");
dbRepHTMLTable tempReport3(dbRepSizer("Demo Columnar Report").pageHeight(80),
dbRepColWidths() << 10 << 15 << 50, theView);
tempReport3.draw(fs3);
fs3.close();
cout << endl << "Creating a PageWise report to oofts14d.htm"<< endl;
ofstream fs4("oofts14d.htm");
dbRepHTMLTable tempReport4(dbRepSizer("Demo Page-wise Report").pageHeight(80),
dbRepColWidths() << 15 << 60,theView, dbRep::pageWise);
tempReport4.draw(fs4);
fs4.close();
cout << "done" << endl;
return EXIT_SUCCESS;
}